import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { Nyt7RegionManagementVO, Nyt7RegionManagementForm, Nyt7RegionManagementQuery } from '@/api/Nyt7RegionManagement/Nyt7RegionManagement/types';

/**
 * 查询区域管理列表
 * @param query
 * @returns {*}
 */

export const listNyt7RegionManagement = (query?: Nyt7RegionManagementQuery): AxiosPromise<Nyt7RegionManagementVO[]> => {
  return request({
    url: '/Nyt7RegionManagement/Nyt7RegionManagement/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询区域管理详细
 * @param regionId
 */
export const getNyt7RegionManagement = (regionId: string | number): AxiosPromise<Nyt7RegionManagementVO> => {
  return request({
    url: '/Nyt7RegionManagement/Nyt7RegionManagement/' + regionId,
    method: 'get'
  });
};

/**
 * 新增区域管理
 * @param data
 */
export const addNyt7RegionManagement = (data: Nyt7RegionManagementForm) => {
  return request({
    url: '/Nyt7RegionManagement/Nyt7RegionManagement',
    method: 'post',
    data: data
  });
};

/**
 * 修改区域管理
 * @param data
 */
export const updateNyt7RegionManagement = (data: Nyt7RegionManagementForm) => {
  return request({
    url: '/Nyt7RegionManagement/Nyt7RegionManagement',
    method: 'put',
    data: data
  });
};

/**
 * 删除区域管理
 * @param id
 */
export const delNyt7RegionManagement = (id: string | number | Array<string | number>) => {
  return request({
    url: '/Nyt7RegionManagement/Nyt7RegionManagement/' + id,
    method: 'delete'
  });
};
